public class Sequentialbinarytrees {
    public static void main(String[] args) {
        int[] arr={22,34,5,2,11,2};
        trees tree = new trees(arr);
        tree.por();
    }
}
class trees{
    private int[] arr;

    public trees(int[] arr) {
        this.arr = arr;
    }

    public void por(){
        this.pororder(0);
    }

    public void pororder(int index){
        if (arr==null||arr.length==0){
            return;
        }
            System.out.print(arr[index]+" ");
            if (2*index+1<arr.length){
                pororder(2*index+1);
            }
            if (2*index+2<arr.length){
                pororder(2*index+2);
            }
    }
}
